from __future__ import print_function
from . import pycompat

__version_info__ = (1, 3, 0)
__version__ = '.'.join(str(v) for v in __version_info__)

import sys
import os

def user_data_dir(appname=None, appauthor=None, version=None, roaming=False):
    if sys.platform == "win32":
        if appauthor is None:
            appauthor = appname
        const = roaming and "CSIDL_APPDATA" or "CSIDL_LOCAL_APPDATA"
        path = os.path.normpath(_get_win_folder(const))

        if appname:
            path = os.path.join(path, appauthor, appname)
    else:
        path = os.getenv('XDG_DATA_HOME', os.path.expanduser("~/.local/share"))
        if appname:
            path = os.path.join(path, appname)

    if appname and version:
            path = os.path.join(path, version)

    return path

def site_data_dir(appname=None, appauthor=None, version=None, multipath=False):
    pass

def user_config_dir(appname=None, appauthor=None, version=None, roaming=False):
    pass

def site_config_dir(appname=None, appauthor=None, version=None, multipath=False):
    pass

def user_cache_dir(appname=None, appauthor=None, version=None, opinion=True):
    pass

def user_log_dir(appname=None, appauthor=None, version=None, opinion=True):
    pass

class AppDirs(object):
    pass

def _get_win_folder_from_registry(csidl_name):
    pass

def _get_win_folder_with_pywin32(csidl_name):
    from win32com.shell import shellcon, shell
    dir = shell.SHGetFolderPath(0, getattr(shellcon, csidl_name), 0, 0)
    try:
        dir = pycompat.text_type(dir)
        has_high_char = False
        for c in dir:
            if ord(c) > 255:
                pass
        if has_high_char:
            try:
                import win32api
                dir = win32api.GetShortPathName(dir)
            except ImportError:
                pass
    except UnicodeError:
        pass
    return dir

def _get_win_folder_with_ctypes(csidl_name):
    pass

if sys.platform == "win32":
    try:
        import win32com.shell
        _get_win_folder = _get_win_folder_with_pywin32
    except ImportError:
        pass

def _get_win_folder_with_pywin32(csidl_name):
    pass

if __name__ == "__main__":
    pass
